package com.vote;

import com.alibaba.fastjson.JSON;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@SpringBootApplication
@MapperScan("com.vote.mapper")
@EnableCaching
public class VoteApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(VoteApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        //注意这里的参数要指向原先用main方法执行的Application启动类
        return builder.sources(VoteApplication.class);
    }



}

class Test{
    static  int i = 10;
    static {
        i+=5;
    }

    public static void main(String[] args) {
        System.out.println(i);
    }
    static {
        i/=3;
    }
}
class Test1{
    static List<Integer> list = Arrays.asList(2,4,1,3,5);

    public static void main(String[] args) {

            String s = null;
        System.out.println("s=="+s);

            for (int i = 0; i < list.size(); ++i) {
                int v = list.get(i);
                if (v % 2 == 0) {
                    list.remove(v);
                }
        }
        System.out.println(JSON.toJSONString(list));
    }
}
